/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Engine2D.geometry;

import Engine2D.engine.Engine;
import Engine2D.graphics.GLColour;

/**
 *
 * @author Garys
 */
public class Rectangle extends Shape {

    /**
     * 
     */
    protected float height;
    /**
     * 
     */
    protected float width;

    /**
     * 
     * @return
     */
    public float getHeight() {
        return height;
    }

    /**
     * 
     * @param height
     */
    public void setHeight(float height) {
        this.height = height;
    }

    /**
     * 
     * @return
     */
    public float getWidth() {
        return width;
    }

    /**
     * 
     * @param width
     */
    public void setWidth(float width) {
        this.width = width;
    }

    /**
     * 
     * @param x
     * @param y
     * @param w
     * @param h
     */
    public Rectangle(float x, float y, float w, float h) {
        this.x = x;
        this.y = y;
        this.width = w;
        this.height = h;
        maxX = x + w;
        maxY = y + h;
        checkPoints();
    }

    @Override
    public void render(int x, int y) {
        
    }

    /**
     * 
     */
    @Override
    protected void createPoints() {
        points = new float[8];

        points[0] = x;
        points[1] = y;

        points[2] = x + width;
        points[3] = y;

        points[4] = x + width;
        points[5] = y + height;

        points[6] = x;
        points[7] = y + height;

        maxX = points[2];
        maxY = points[5];
        minX = points[0];
        minY = points[1];
    }

    /**
     * 
     * @param transform
     * @return
     */
    @Override
    public Shape transform(Transform transform) {
        return this;
    }
}
